package com.demo.transaction.service;

import com.demo.transaction.dao.db1.EMapper;
import com.demo.transaction.dao.db2.FMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class BService {

    @Autowired
    private EMapper eMapper;

    @Autowired
    private FMapper fMapper;

    @Transactional(value = "transactionManager1")
    public void testDemo(){
        eMapper.insertB("张三");
        eMapper.insertB("张三");
        fMapper.insertB("李四");
        fMapper.insertB("李四");
        System.out.println(1/0);
    }

}
